<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:s="http://jboss.org/schema/seam/taglib"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:rich="http://richfaces.org/rich"
  template="./WEB-INF/template/template_2x.xhtml">

  <ui:define
    name="page_title">#{msgs.format('jsf.SearchResultsForProjectSearch',
      projectSearch.projectAutocomplete.query)}</ui:define>
  <ui:define name="center_content">
    <h1>#{msgs.format('jsf.projectSearch.searchQuery.title',
      projectSearch.projectAutocomplete.query)}</h1>
    <h:form>
      <div style="text-align: center">
        <rich:dataScroller renderIfSinglePage="false" for="searchResults"
          page="#{projectSearch.projectPagedListDataModel.scrollerPage}" id="scroller"
          fastControls="hide" render="scroller, searchResults">
          <f:facet name="first">
            <h:outputText value="" styleClass="icon-to-start"/>
          </f:facet>
          <f:facet name="previous">
            <h:outputText value="" styleClass="icon-left-open"/>
          </f:facet>
          <f:facet name="next">
            <h:outputText value="" styleClass="icon-right-open-1"/>
          </f:facet>
          <f:facet name="fastforward">
            <h:outputText value="" styleClass="icon-fast-fw-1"/>
          </f:facet>
          <f:facet name="last">
            <h:outputText value="" styleClass="icon-to-end"/>
          </f:facet>

          <f:facet name="first_disabled">
            <h:outputText value="" styleClass="icon-to-start"/>
          </f:facet>
          <f:facet name="previous_disabled">
            <h:outputText value="" styleClass="icon-left-open"/>
          </f:facet>
          <f:facet name="next_disabled">
            <h:outputText value="" styleClass="icon-right-open-1"/>
          </f:facet>
          <f:facet name="fastforward_disabled">
            <h:outputText value="" styleClass="icon-fast-fw-1"/>
          </f:facet>
          <f:facet name="last_disabled">
            <h:outputText value="" styleClass="icon-to-end"/>
          </f:facet>
        </rich:dataScroller>
      </div>

      <rich:dataTable id="searchResults" columnsWidth="200px,200px,80px"
        rows="#{projectSearch.projectPagedListDataModel.pageSize}"
        value="#{projectSearch.getProjectPagedListDataModel()}" var="project">
        <rich:column>
          <f:facet name="header">#{msgs['jsf.ProjectName']}</f:facet>
          <s:link id="project" value="#{project.name}" propagation="none"
            styleClass="table_link #{project.status eq 'READONLY' ? 'readonly_link' : (project.status eq 'OBSOLETE' ? 'obsolete_link' : '')}"
            view="/project/project.xhtml">
            <f:param name="slug" value="#{project.slug}"/>
          </s:link>
        </rich:column>
        <rich:column>
          <f:facet name="header">#{msgs['jsf.Description']}</f:facet>
          <h:outputText value="#{project.description}"/>
        </rich:column>
        <rich:column>
          <f:facet name="header">#{msgs['jsf.CreationDate']}</f:facet>
          <h:outputText value="#{project.creationDate}">
            <f:convertDateTime type="date" dateStyle="default"/>
          </h:outputText>
        </rich:column>
      </rich:dataTable>
    </h:form>

  </ui:define>

</ui:composition>
